package com.itboye.mengwu.data.presenter;

import java.util.List;
import java.util.Observer;

import com.itboye.core.interfaces.ICompleteListener;
import com.itboye.core.object.BasePresenter;
import com.itboye.core.object.ResultEntity;
import com.itboye.mengwu.app.ui.main.MainPresenter;
import com.itboye.mengwu.data.interfaces.IAddGoods;
import com.itboye.mengwu.data.interfaces.IWoMengAddGoods;
import com.itboye.mengwu.data.model.GoodsListModel;
import com.itboye.mengwu.data.model.WoMengGoodsListModel;
import com.itboye.mengwu.data.repository.AddGoodsRepository;
import com.itboye.mengwu.data.repository.WoMengCollectionRepository;

public class WoMengCollectionPresenter extends BasePresenter implements IWoMengAddGoods<WoMengGoodsListModel>{

	//我萌中的商品收藏查询
		public static final String WoMengCollecteGoodsQuery_success = MainPresenter.class.getName()
				+ "_ WoMengCollecteGoodsQuery_success";
		public static final String WoMengCollectGoodsQuery_fail = MainPresenter.class.getName()
				+ "_ WoMengCollecteGoodsQuery_fail";
	
	public WoMengCollectionPresenter(Observer observer) {
		super(observer);
		// TODO Auto-generated constructor stub
	}

	@Override
	public void add(WoMengGoodsListModel model) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void delete(WoMengGoodsListModel model) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void update(WoMengGoodsListModel model) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void getInfo(WoMengGoodsListModel model) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public List<WoMengGoodsListModel> query(WoMengGoodsListModel model) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public void queryWoMengCollectionGoods(String uid, String pageNo, String pageSize) {
		// TODO Auto-generated method stub
		IWoMengAddGoods<WoMengGoodsListModel> addGoods = new WoMengCollectionRepository(
				new ICompleteListener() {
			
			@Override
			public void success(ResultEntity result) {
				// TODO Auto-generated method stub
				result.setEventTag(Tag_Success);
				result.setEventType(WoMengCollecteGoodsQuery_success);
				WoMengCollectionPresenter.this.setChanged();
				WoMengCollectionPresenter  .this.notifyObservers(result);
			}
			
			@Override
			public void failure(ResultEntity result) {
				// TODO Auto-generated method stub
				
			}
		});
		addGoods.queryWoMengCollectionGoods(uid, pageNo, pageSize);
	}

}
